import request from '@/utils/request.js'
const api_name = '/user/auth/user'
export default {
  updateUsername(obj) {
    return request({
      url: api_name + '/updateUsername',
      method: 'post',
      data: obj,
    })
  },
  updatePassword(userId, oldPassword, newPassword) {
    return request({
      url: api_name + '/updatePassword',
      method: 'post',
      params: {
        userId,
        oldPassword,
        newPassword,
      },
    })
  },
  updatePhone(userId, phone) {
    return request({
      url: api_name + '/updatePhone',
      method: 'post',
      params: {
        userId,
        phone,
      },
    })
  },
  getUserInfo(userId) {
    return request({
      url: api_name + '/' + userId,
      method: 'GET',
    })
  },
}
